package com.krain.ddbb.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by ex-kuangxiaomin101 on 2016-01-13.
 */
public class UserIssueBean implements Parcelable {
    private int id;
    private String order_num;
    private ArrayList<String> image;
    private String desc;
    private String server_price;
    private String publish_time;
    private String address;
    private int status;  //0发布成功，未抢单 1抢单成功,待确认　2确认成功，待服务  3服务了，待付款　4 付款了,待评论 5交易成功   6已取消
    private String server_time;
    private String username;
    private String phone;
    private UserServer server_user;
    private int confirm_status;
    private int currentIdStatus;//当前用户的身份  0 普通客户  1技工

    public static final int STATUS_COMPLETE = 5;//已完成
    public static final int STATUS_WAIT_CONFIRM = 1;//待确认
    public static final int STATUS_WAIT_SERVICE = 2;//待服务
    public static final int STATUS_WAIT_PAY = 3;//等待付款
    public static final int STATUS_WAIT_COMMENT = 4;//待评论
    public static final int STATUS_CANCEL = 6;//已取消
    public static final int STATUS_WAIT_ROB = 0;//已发布，未抢单
    public static final int CURRENTSTATUS_CLIENT = 0;//普通用户
    public static final int CURRENTSTATUS_WORKER = 1;//技工


    public int getCurrentIdStatus() {
        return currentIdStatus;
    }

    public ArrayList<String> getImage() {
        return image;
    }

    public void setImage(ArrayList<String> image) {
        this.image = image;
    }

    public void setCurrentIdStatus(int currentIdStatus) {
        this.currentIdStatus = currentIdStatus;
    }

    public UserServer getServer_user() {
        return server_user;
    }

    public void setServer_user(UserServer server_user) {
        this.server_user = server_user;
    }

    public int getConfirm_status() {
        return confirm_status;
    }

    public void setConfirm_status(int confirm_status) {
        this.confirm_status = confirm_status;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getOrder_num() {
        return order_num;
    }

    public void setOrder_num(String order_num) {
        this.order_num = order_num;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getServer_price() {
        return server_price;
    }

    public void setServer_price(String server_price) {
        this.server_price = server_price;
    }

    public String getPublish_time() {
        return publish_time;
    }

    public void setPublish_time(String publish_time) {
        this.publish_time = publish_time;
    }

    public String getServer_time() {
        return server_time;
    }

    public void setServer_time(String server_time) {
        this.server_time = server_time;
    }


    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public UserIssueBean() {
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public String toString() {
        return "UserIssueBean{" +
                "id=" + id +
                ", order_num='" + order_num + '\'' +
                ", desc='" + desc + '\'' +
                ", server_price='" + server_price + '\'' +
                ", publish_time='" + publish_time + '\'' +
                ", status='" + status + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.order_num);
        dest.writeStringList(this.image);
        dest.writeString(this.desc);
        dest.writeString(this.server_price);
        dest.writeString(this.publish_time);
        dest.writeString(this.address);
        dest.writeInt(this.status);
        dest.writeString(this.server_time);
        dest.writeString(this.username);
        dest.writeString(this.phone);
        dest.writeParcelable(this.server_user, 0);
        dest.writeInt(this.confirm_status);
        dest.writeInt(this.currentIdStatus);
    }

    protected UserIssueBean(Parcel in) {
        this.id = in.readInt();
        this.order_num = in.readString();
        this.image = in.createStringArrayList();
        this.desc = in.readString();
        this.server_price = in.readString();
        this.publish_time = in.readString();
        this.address = in.readString();
        this.status = in.readInt();
        this.server_time = in.readString();
        this.username = in.readString();
        this.phone = in.readString();
        this.server_user = in.readParcelable(UserServer.class.getClassLoader());
        this.confirm_status = in.readInt();
        this.currentIdStatus = in.readInt();
    }

    public static final Creator<UserIssueBean> CREATOR = new Creator<UserIssueBean>() {
        public UserIssueBean createFromParcel(Parcel source) {
            return new UserIssueBean(source);
        }

        public UserIssueBean[] newArray(int size) {
            return new UserIssueBean[size];
        }
    };
}
